package com.un.ebs.sale.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.un.ebs.core.metadata.DbField;
import com.un.ebs.sale.enums.SaleOrderTypeEnum;
import lombok.Data;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Date;

/**
 * (SaleOrder)表实体类
 *
 * @author liubo
 * @since 2020-08-21 11:42:15
 */
@Data
@Component
@TableName("tb_sale_order")
@SuppressWarnings("serial")
public class SaleOrder extends Model<SaleOrder> {

    @TableId(value = "id", type = IdType.UUID)
    private String id;


    @DbField(name = "code", length = 100, precision = 0)
    private String code;

    @DbField(name = "contract_code", length = 100, precision = 0)
    private String contractCode;

    @DbField(name = "customer_ent_id", length = 40, precision = 0)
    private String customerEntId;

    @DbField(name = "customer_ent_name", length = 40, precision = 0)
    private String customerEntName;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_at", length = 40, precision = 0)
    private String createAt;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_at_name", length = 100, precision = 0)
    private String createAtName;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_time", length = -1, precision = 0)
    private Date createTime;

    @DbField(name = "submit_status", length = -1, precision = 0)
    private Boolean submitStatus;

    @DbField(name = "submit_time", length = -1, precision = 0)
    private Date submitTime;

    @DbField(name = "submit_at", length = 40, precision = 0)
    private String submitAt;

    @DbField(name = "submit_at_name", length = 100, precision = 0)
    private String submitAtName;

    @DbField(name = "personnel_id", length = 40, precision = 0)
    private String personnelId;

    @DbField(name = "personnel_name", length = 100, precision = 0)
    private String personnelName;

    @DbField(name = "plan_deliver_date", length = -1, precision = 0)
    private Date planDeliverDate;

    @DbField(name = "deliver_time", length = -1, precision = 0)
    private Date deliverTime;

    @DbField(name = "deliver_at", length = 40, precision = 0)
    private String deliverAt;

    @DbField(name = "deliver_at_name", length = 100, precision = 0)
    private String deliverAtName;

    @DbField(name = "deliver_status", length = -1, precision = 0)
    private Boolean deliverStatus;

    @DbField(name = "tenant_id", length = 40, precision = 0)
    private String tenantId;

    @TableLogic
    @DbField(name = "is_delete", length = -1, precision = 0)
    private Boolean isDelete;

    @DbField(name = "remark", length = 1000, precision = 0)
    private String remark;

    @DbField(name = "order_type", length = -1, precision = 0)
    private SaleOrderTypeEnum orderType;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}